package cn.chainco.cts.jdo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * cts雇员表，包含员工/客户
 */
@Entity
@Table(name = "cts_employee")
public class Employee implements Serializable {

	private static final long serialVersionUID = -8475045826892953708L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private User user; // cts用户id

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "companyId")
	private Company company; // 用户所属公司

	@Column(length = 20)
	private String nickname; // 昵称
	
	@Column(length = 20)
	private String fullname; // 全称

	@Column(length = 32)
	private String inviteCode; // 邀请码

	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false)
	private Date createTime; // 创建日期

	@Column
	private Integer type = 0; // 用户类型：0.员工；1.访客；2.公司管理员
	
	@Column
	private Integer invite = 0; // 用户类型：0没邀请;1邀请中,2已邀请

	@Column
	private Integer status = 1; // 用户状态：1正常；2禁用

	@Column
	private Integer auth1 = 0; // 权限-创建订单：0无；1有

	@Column
	private Integer auth2 = 0; // 权限-创建订单奖励：0无；1有

	@Column
	private Integer auth3 = 0; // 权限-创建委托项目：0无；1有

	@Column
	private Integer auth4 = 0; // 权限-创建标签：0无；1有

	@Column
	private Integer auth5 = 0; // 权限-创建访客：0无；1有

	@Column
	private Integer auth6 = 0; // 权限-创建文档模版：0无；1有

	@Column
	private Integer auth7 = 0; // 权限-创建财务收入：0无；1有

	@Column
	private Integer auth8 = 0; // 权限-创建财务支出：0无；1有

	@Column
	private Integer auth9 = 0; // 权限-创建财务奖励：0无；1有
	
	@Column
	private Integer auth10 = 0; // 权限-创建费用：0无；1有

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	

	public String getFullname() {
		return fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	public String getInviteCode() {
		return inviteCode;
	}

	public void setInviteCode(String inviteCode) {
		this.inviteCode = inviteCode;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	
	public Integer getInvite() {
		return invite;
	}

	public void setInvite(Integer invite) {
		this.invite = invite;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getAuth1() {
		return auth1;
	}

	public void setAuth1(Integer auth1) {
		this.auth1 = auth1;
	}

	public Integer getAuth2() {
		return auth2;
	}

	public void setAuth2(Integer auth2) {
		this.auth2 = auth2;
	}

	public Integer getAuth3() {
		return auth3;
	}

	public void setAuth3(Integer auth3) {
		this.auth3 = auth3;
	}

	public Integer getAuth4() {
		return auth4;
	}

	public void setAuth4(Integer auth4) {
		this.auth4 = auth4;
	}

	public Integer getAuth5() {
		return auth5;
	}

	public void setAuth5(Integer auth5) {
		this.auth5 = auth5;
	}

	public Integer getAuth6() {
		return auth6;
	}

	public void setAuth6(Integer auth6) {
		this.auth6 = auth6;
	}

	public Integer getAuth7() {
		return auth7;
	}

	public void setAuth7(Integer auth7) {
		this.auth7 = auth7;
	}

	public Integer getAuth8() {
		return auth8;
	}

	public void setAuth8(Integer auth8) {
		this.auth8 = auth8;
	}

	public Integer getAuth9() {
		return auth9;
	}

	public void setAuth9(Integer auth9) {
		this.auth9 = auth9;
	}

	public Integer getAuth10() {
		return auth10;
	}

	public void setAuth10(Integer auth10) {
		this.auth10 = auth10;
	}
	
	

}
